﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NLBS.Entity" assembly="NLBS.Entity">
  <class name="Article" table="blog_Article">
    <id name="ArticleID" column="log_id" type="Int32">
      <generator class="native" />
    </id>
    <property name="CategoryID" column="log_catID" type="Int32" />
    <property name="Title" column="log_title" type="String" not-null="true" />
    <property name="AuthorID" column="log_authorID" type="Int32" not-null="true"  />
    <property name="Author" column="log_author" type="String" />
    <property name="EditMark" column="log_editMark" type="String" />
    <property name="TrackbackURL" column="log_trackbackURL" type="String" />
    <property name="Content0" column="log_content0" type="String" not-null="true" />
    <property name="Content1" column="log_content1" type="String" />
    <property name="Mode" column="log_mode" type="Int32" />
    <property name="Locked" column="log_locked" type="Boolean" />
    <property name="Selected" column="log_selected" type="Boolean" />
    <property name="UbbFlags" column="log_ubbFlags" type="String" />
    <property name="PostTime" column="log_postTime" type="DateTime" not-null="true" />
    <property name="IP" column="log_ip" type="String" />
    <property name="CommentCount" column="log_commentCount" type="Int32" />
    <property name="ViewCount" column="log_viewCount" type="Int32" />
    <property name="TrackBackCount" column="log_trackbackCount" type="Int32" />
    <property name="IsTop" column="log_IsTop" type="Boolean" />
    <property name="EnableInRss" column="log_EnableRss" type="Boolean" />

    <!--<many-to-one name="Category" class="Category"
                 insert="false"
                 not-found="ignore" column="log_catID"/>-->
    
    <set name="Comments" generic="true">
      <key column="log_id"/>
      <one-to-many class="Comment" not-found="ignore"/>
    </set>

    <bag name="TrackBacks">
        <key column="ArticleID"/>
        <one-to-many class="TrackBack"/>
    </bag>

    <bag name="TagList" table="blog_ArticleTag">
      <key column="log_ID" />
      <many-to-many class="Tag" column="tag_ID" />
    </bag>
    
  </class>
</hibernate-mapping>